package com.wjmj.balloon.debugger.actions;

import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.actions.ActionGroup;

import balloondebugger.Activator;

public class BreakpointActionGroup extends ActionGroup {

	private Action rem_coAction;
	private Action rem_all_coAction;
	private Action debugt_objAction;
	private Action file_objAction;
	private Action skip_brkpAction;
	private Action expandallAction;
	private Action collapseallAction;
	private Action syncedAction;

	@Override
	public void fillActionBars(IActionBars actionBars) {
		if (actionBars == null)
			return;

		makeActions();

		IToolBarManager toolBarManager = actionBars.getToolBarManager();
		toolBarManager.add(rem_coAction);
		toolBarManager.add(rem_all_coAction);
		toolBarManager.add(debugt_objAction);
		toolBarManager.add(file_objAction);
		toolBarManager.add(skip_brkpAction);
		toolBarManager.add(new Separator());
		toolBarManager.add(expandallAction);
		toolBarManager.add(collapseallAction);
		toolBarManager.add(syncedAction);
	}

	private void makeActions() {

		// rem_co
		rem_coAction = new Action() {
			public void run() {
				// TODO do rem_co
			}
		};
		rem_coAction.setToolTipText("Remove Selected Breakpoints");
		rem_coAction.setImageDescriptor(Activator
				.getImageDescriptor("icons/breakpoint/rem_co.gif"));
		
		// rem_all_co
		rem_all_coAction = new Action() {
			public void run() {
				// TODO do rem_all_co
			}
		};
		rem_all_coAction.setToolTipText("Remove All Breakpoints");
		rem_all_coAction.setImageDescriptor(Activator
				.getImageDescriptor("icons/breakpoint/rem_all_co.gif"));

		// debugt_obj
		debugt_objAction = new Action() {
			public void run() {
				// TODO do debugt_obj
			}
		};
		debugt_objAction.setToolTipText("Show Breakpoints Supported By Selected Target");
		debugt_objAction.setImageDescriptor(Activator
				.getImageDescriptor("icons/breakpoint/debugt_obj.gif"));

		// file_obj
		file_objAction = new Action() {
			public void run() {
				// TODO do file_obj
			}
		};
		file_objAction.setToolTipText("Go To File For Breakpoint");
		file_objAction.setImageDescriptor(Activator
				.getImageDescriptor("icons/breakpoint/file_obj.gif"));

		// skip_brkp
		skip_brkpAction = new Action() {
			public void run() {
				// TODO do skip_brkp
			}
		};
		skip_brkpAction.setToolTipText("Skill All Breakpoints");
		skip_brkpAction.setImageDescriptor(Activator
				.getImageDescriptor("icons/breakpoint/skip_brkp.gif"));

		// expandall
		expandallAction = new Action() {
			public void run() {
				// TODO do expandall
			}
		};
		expandallAction.setToolTipText("Expend All");
		expandallAction.setImageDescriptor(Activator
				.getImageDescriptor("icons/breakpoint/expandall.gif"));

		// collapseall
		collapseallAction = new Action() {
			public void run() {
				// TODO do collapseall
			}
		};
		collapseallAction.setToolTipText("Collapse All");
		collapseallAction.setImageDescriptor(Activator
				.getImageDescriptor("icons/breakpoint/collapseall.gif"));

		// synced
		syncedAction = new Action() {
			public void run() {
				// TODO do synced
			}
		};
		syncedAction.setToolTipText("Link With Debug View");
		syncedAction.setImageDescriptor(Activator
				.getImageDescriptor("icons/breakpoint/synced.gif"));
	}

}
